/*
 * ============================================================================
 * Copyright Notice!
 * ----------------------------------------------------------------------------
 * This file contains proprietary and confidential information belonging to the
 * group of people involvled in developing this project.  Reproduction, disclosure 
 * or use without specific written authorization from project stake holders is 
 * prohibited. Please refer the readme.txt in project installation folder for more
 * specific contacts
 *
 * All rights reserved.
 * ============================================================================
 */
package edu.uwm.universitydb.dao.coinvestigate;

import java.sql.PreparedStatement;
import java.sql.SQLException;

import edu.uwm.universitydb.framework.nontransactional.db.command.impl.NonTransactionalDataManipulationCommandBase;

/**
 * <code>CoInvestigatorInsertCommand</type>
 * 
 * @author Shyam Nair
 */
public class CoInvestigatorInsertCommand extends NonTransactionalDataManipulationCommandBase
{
    /** static string representing insert query */
    private static final String INSERT_QUERY =
        "insert into university.co_investigate (prof_ssn, pno) values (?,?);";

    /** attribute holding ssn */
    final String mSSN;

    /** attribute holding project number */
    final Integer mProjectNum;

    /**
     * 
     * @param ssn
     * @param pNo
     */
    public CoInvestigatorInsertCommand(final String ssn, final Integer pNo)
    {
        mSSN = ssn;
        mProjectNum = pNo;
    }

    /*
     * (non-javadoc)
     * @see edu.uwm.universitydb.framework.db.command.DBCommand#getSQL()
     */
    @Override
    public String getSQL()
    {
        return INSERT_QUERY;
    }

    /*
     * (non-javadoc)
     * @see edu.uwm.universitydb.framework.db.command.DBCommand#setParameters(java.sql.PreparedStatement)
     */
    @Override
    public void setParameters(final PreparedStatement pStmt) throws SQLException
    {
        pStmt.setString(1, mSSN);
        pStmt.setInt(2, mProjectNum);
    }

}
/*
 * ============================================================================
 * Change History
 * ----------------------------------------------------------------------------
 * Apr 23, 2014   Shyam Nair
 * File created
 * ----------------------------------------------------------------------------
 */